<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        数学：<input type="text" v-model="shuxuscore" />
        英语：<input type="text" v-model="yingyuscore" /><br>
        总得分：<input type="text" v-model="sumScore()" />
        总得分2：<input type="text" v-model="sumScore1" />
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
</body>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            shuxuscore: 100,
            yingyuscore: 100
        },
        methods: {
            sumScore: function () {
                console.info("执行了sumScore")
                return this.shuxuscore + this.yingyuscore
            }
        },
        computed: {
            sumScore1: function () {
                console.info("执行了sumScore1")
                return this.shuxuscore + this.yingyuscore
            }
        }
    })
</script>

</html>